package com.ziyia.lifecycles;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Lifecycle;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Lifecycle lifecycle = getLifecycle();
        MyObserver myObserver = new MyObserver(lifecycle);
        lifecycle.addObserver(myObserver);
        myObserver.getActivityStatus();
    }
}